From 9a0416c13e4dd343898cff578e2c9342beaca2e0 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Tue, 6 Apr 2004 23:08:57 +0000 Subject: [PATCH] if user is blocked with an expiry date, do not add autoblock expiry date on top of that but instead reuse it --- includes/User.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/User.php b/includes/User.php index 772672eccc..35d5526899 100644 --- a/includes/User.php +++ b/includes/User.php @@ -622,7 +622,13 @@ class User { $ipblock->mReason = wfMsg( "autoblocker", $this->getName(), $userblock->mReason ); $ipblock->mTimestamp = wfTimestampNow(); $ipblock->mAuto = 1; - $ipblock->mExpiry = Block::getAutoblockExpiry( $ipblock->mTimestamp ); + # If the user is already blocked with an expiry date, we don't + # want to pile on top of that! + if($userblock->mExpiry) { + $ipblock->mExpiry = $userblock->mExpiry; + } else { + $ipblock->mExpiry = Block::getAutoblockExpiry( $ipblock->mTimestamp ); + } # Insert it $ipblock->insert(); -- 2.20.1